/**
 * Baidu.com Inc.
 * Copyright (c) 2022 All Rights Reserved.
 */
package guaduation.processTemplate;

import java.lang.reflect.InvocationTargetException;

/**
 * @author wangjiajun06
 * @version 1.0
 * @description
 * @date 2022/1/18 3:24 下午
 */
public class TemplateFactory {
    public static AbstractProcessTemplate createTemplate(String classname) {
        try {
            return (AbstractProcessTemplate) Class.forName(classname).getDeclaredConstructor().newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return null;
    }
}
